﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;

public partial class 练习_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        OleDbConnection connection = new OleDbConnection(conn.Connstr);
       OleDbCommand mycommond = new OleDbCommand();
        mycommond.Connection = connection;
        mycommond.CommandTimeout = 15;
        mycommond.CommandText = "select * from admin";
        connection.Open();
        Response.Write("成功连接数据库<br />");
        OleDbDataReader reader=mycommond.ExecuteReader();
        while (reader.Read())
        {
            Response.Write(String.Format("{0},{1}:{2}<br />", reader[1],reader[2],reader[3]));
        }
        Response.Write("<br />输出完毕<br />");
        connection.Close();
        Response.Write("成功关闭数据库");

    }
}
